import { createRouter, createWebHistory } from 'vue-router'
import ComCarList from "@/components/ComCarList.vue";
import ComLogin from "@/components/ComLogin.vue";
import ComLogged from "@/components/ComLogged.vue";
import Page_1View from "@/views/Logged/Page_1View.vue";
import Page_2View from "@/views/Logged/Page_2View.vue";
import Page_3View from "@/views/Logged/Page_3View.vue";
import Page_4View from "@/views/Logged/Page_4View.vue";
import loginView from "@/views/login/loginView.vue";
import HomeLoggedView from "@/views/home/HomeLoggedView.vue";
import HomeView from "@/views/home/HomeView.vue";
import HomePageView from "@/views/HomePage/HomePageView.vue";
import ArticleDetailComponent from "@/components/ArticleDetailComponent.vue";
import InfoView from "@/views/home/InfoView.vue";
import HomeUnloggedView from "@/views/home/HomeUnloggedView.vue";
import QustView from "@/views/Qust/QustView.vue";
import VideoView from "@/views/Video/VideoView.vue";
import SearchView from "@/views/HomePage/SearchView.vue";


const routes = [
  {
    path: '',
    name: 'car',
    component: ComCarList
  },
  {
    path: '/article/:artId',
    name: 'article-detail',
    component: ArticleDetailComponent
  },
  {
    path: '/car',
    component: ComCarList
  },
  {
    path: '/login',
    name: 'login',
    component: ComLogin
  },
  {
    path: '/logged',
    name: 'logged',
    component: ComLogged,
    children: [
      {
        path: '',
        name: 'page1',
        component: Page_1View,
      },
      {
        path: '/page1',
        component: Page_1View,
      },
      {
        path: '/page2',
        name: 'page2',
        component: Page_2View,
      },
      {
        path: '/page3',
        name: 'page3',
        component: Page_3View,
      },
      {
        path: '/page4',
        name: 'page4',
        component: Page_4View,
      },
    ]
  },
  {
    path: '/loginHome',
    name: 'loginHome',
    component: loginView
  },
  {
    path: '/home',
    name: 'home',
    component: HomeView,
    children:[
      {
        path: '/logged_2',
        name: 'logged_2',
        component: HomeLoggedView
      },
      {
        path: '/homePage',
        name: 'homePage',
        component: HomePageView,
      },
      {
        path: '/info',
        name: 'info',
        component: InfoView
      },
      {
        path: '/unlogged',
        name: 'unlogged',
        component: HomeUnloggedView
      },
      {
        path: '/video',
        name: 'video',
        component: VideoView
      },
      {
        path: '/qust',
        name: 'qust',
        component: QustView
      },
      {
        path: '/search',
        name: 'search',
        component: SearchView
      },
    ]
  },

]
const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes
})

export default router
